using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
namespace DAL
{
    public class Tags : DAL.DataManager<Tag>
    {
        private static Tags Instance = new Tags();
        static Tags() { }

        public override string TableName
        {
            get { return @"awesome_tags"; }
        }

        protected override void CopyToItem(DataRow Row, Tag Item)
        {
            Item.TagName = Convert.ToString(Row["TagName"]);
        }

        protected override void CopyFromItem(DataManagerQuery query, Tag Item)
        {
            query.AddParam("TagName", Item.TagName);
        }

        public static Tag Item(Int64 id)
        {
            return Instance.GetItem(id);
        }

        public static List<Tag> All()
        {
            return Instance.GetItems();
        }

        public static void Add(Tag Item)
        {
            Instance.Insert(Item);
        }

        public static void Save(Tag Item)
        {
            Instance.Update(Item);
        }
    }

    public class Tag : DAL.DataManagerRow
    {
        private string _TagName;
        public string TagName
        {
            get
            {
                return _TagName;
            }
            set
            {
                _TagName = value;
            }
        }
    }
}